<!--[form:product]-->
<p>
  <% fields_for :sku, @product.sku do |s| %>
    <label for="product_sku">Sku</label><br/>
    <%= s.text_field :number %>
  <% end %>
</p>
<p>
  <label for="product_name">Name</label><br/>
  <%= f.text_field :name  %>
</p>
<p>
  <label for="product_description">Description</label><br/>
  <%= f.text_area :description, {:cols => 90, :rows => 10} %>
</p>
<p>
<p>
  <label for="price">Price:</label><br/>
  <%= f.text_field :price  %></p>
</p>
<p>
  <label for="category">Category:</label><br/>
  <select id="category" 
	        name="category" 
					style="width:250px;"> 
    <%= options_from_collection_for_select(@all_categories, :id, :long_name, @selected_category) %>
  </select>
	<%= observe_field :category, 
                    :update => 'treatmentWrapper', 
                    :url => {:action => :tax_treatments}, 
                    :with => "'id=#{@product.id}&category_id=' + encodeURIComponent(value)", 
                    :on => 'changed' -%> 
  <%= observe_field :category, 
                    :update => 'variationsWrapper', 
                    :url => {:controller => :variations, :action => :product_variations}, 
                    :with => "'product_id=#{@product.id}&category_id=' + encodeURIComponent(value)",
                    :on => 'changed' -%>                    
</p>


<p>
  <label for="tags">Tags:</label><br/>
  <input autocomplete="off" id="product_tags" name="tags" value="<%= @product.tag_list %>" size="35" type="text"/>
</p>

<div id="variationsWrapper">
  <%= render :partial => 'shared/variations', :locals => {:variations => @product.variations, :product => @product, :category => nil} -%>
</div>
<div id="treatmentWrapper">
  <%= render :partial => 'shared/tax_treatments', :locals => {:tax_treatments => @all_tax_treatments, :selected_treatments => @product.tax_treatments} -%>
</div>
<div id="tags_update"></div>

<!--[eoform:product]-->

